package com.netty.demo.client.demo;

import com.netty.demo.client.demo.netty.NettyUdpClient;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * @author Administrator
 */
@SpringBootApplication
public class NettyDemoClientApplication implements CommandLineRunner {
    public static void main(String[] args) {
        SpringApplication.run(NettyDemoClientApplication.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        //创建并启动一个新的的实例
        NettyUdpClient nettyUdpClient = new NettyUdpClient();
        try {
            nettyUdpClient.run();
        } finally {
            nettyUdpClient.stop();
        }
    }
}
